package com.personas.analysic.analyserv.reduce;

import com.personas.analysic.analyserv.entity.YearBase;
import org.apache.flink.api.common.functions.ReduceFunction;

public class YearBaseReduce implements ReduceFunction<YearBase>{


    @Override
    public YearBase reduce(YearBase t1, YearBase t2) throws Exception {
        String year = t1.getYear();
        int cun = t1.getCount() + t2.getCount();
        YearBase finaYear = new YearBase();
        finaYear.setYear(year);
        finaYear.setCount(cun);
        return finaYear;
    }
}
